package exceptionhomework;

import java.io.FileOutputStream;

public class AutoCloseableDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了");
        try(
                FileOutputStream fos=new FileOutputStream("./a/fos.dat")
                ){
            fos.write(1);
        }catch (Exception e){
            System.out.println("发现异常并解决");
        }
        System.out.println("程序结束了");
    }
}
